import { defHttp } from '@/utils/http/axios'
import { ChartData } from './model/chart'

enum Api {
  GET_CHART_ONE = '/chart/dict/thisData',

  GET_CHART_LIST = '/chart/dict/compareBarChart',
  GET_CHART_CHILD_LIST = '/chart/dict/childData',
  GET_CHART_CHILD_REAL_TIME_LIST = '/chart/dict/childRealTimeData',
  GET_CHART_CHILD_LIST_Div = '/chart/dict/childDataDiv',
  GET_CHART_CHILD_LIST_COP = '/chart/dict/cop',
  GET_PIE_CHART_CHILD_LIST = '/chart/dict/totalTypePie',
  GET_totalCodeAndInfo = '/chart/gas/gasCodeAndInfo',
  GET_TYPE_USAGE_COST_CHART_DATA = '/chart/dict/totalCodeAndInfo',
  GET_TYPE_USAGE_COST_CHART_DATA_FOBY_PROPORTION = '/chart/dict/totalCodeAndInfoByProportion',
  GET_TYPE_USAGE_COST_n2UnitPrice_DATA = '/chart/gas/n2UnitPrice',
  GET_TYPE_USAGE_COST_CHART_UPPTOWFS_DATA = '/chart/dict/childDataCostDiv',
  GET_CHILD_COST_CHART_DATA = '/chart/dict/compareOneCodeAndInfo',
  GET_COST_CHART_DATA = '/chart/dict/compareCodeAndInfo',
  GET_COST_CHARTAVG_DATA = '/chart/dict/compareCodeAndInfoAvg',
  CHART_CHILD_LIST_EXPORT = '/chart/dict/childData/export',
  CHART_CHILD_LIST_EXPORTNEW = '/chart/dict/childData/exportNew', //冷却塔导出
  CHART_CHILD_childDataLengRe_EXPORT = '/generalExport/childDataLengRe/export',
  GET_WEEKLY_DATACHAIN_DATA = '/homologyChain/dataChain',
  GET_WEEKLY_TOTAL_DATACHAIN_DATA = '/homologyChain/totalDataChain',
  GET_GENERALEXPORT_DATA = '/generalExport/export',
  GET_GENERALEXPORT_weekly_DATA = '/generalExport/ac/weekly/export',
  GET_SELECTGM_DATA = '/tgm/consumption/selectTgmData',
  POST_TGM_ADDORUPDATE = '/tgm/consumption/addOrUpdate',
  GET_CCSS_SELECTCCSSCONSUMPTIONDATA = '/ccss/consumption/selectCcssConsumptionData',
  GET_CCSS_SELECTCCSSEMISSIONDATA = '/ccss/consumption/selectCcssEmissionData',
  POST_CCSS_CONSUMPTIONADDORUPDATE = '/ccss/consumption/cssConsumptionAddOrUpdate', //新增化学品原液使用量
  POST_CCSS_EMISSIONADDORUPDATE = '/ccss/consumption/ccssEmissionAddOrUpdate', //新增化学品原液使用量
  GET_CHILDDATAVERAGESUM = '/chart/dict/childDatAverageSum',
  GET_AIRTEMPERATURE = '/air/temperatureAndHumidityTwoDay',
  child_Data_LengRePie = '/chart/dict/childDataLengRePie',
  GET_SINGLECASEUSAGEANDCOMPREHENSIVECOST = '/chart/dict/singleCaseUsageAndComprehensiveCost',
  GET_STACKUSAGEANDCOMPREHENSIVECOST = '/chart/dict/stackUsageAndComprehensiveCost',
  GET_COMPREHENSIVESINGLECOST = '/chart/dict/comprehensiveSingleCost',
  GET_ANALYSIS_OF_ENERGY ='/chart/dict/AnalysisOfEnergyConsumptionOfColdAndHeatSources',
  EXPORT_ANALYSIS_OF_ENERGY = '/chart/dict/AnalysisOfEnergyConsumptionOfColdAndHeatSources/export',
  GET_MAU_ENERGY_CONSUMPTION_ANALYSIS = '/chart/dict/MAUEnergyConsumptionAnalysis',
  EXPORT_MAU_ENERGY_CONSUMPTION_ANALYSIS = '/chart/dict/MAUEnergyConsumptionAnalysis/export',
  GET_ANALYSIS_OF_WATER = '/chart/dict/AnalysisOfWaterUsedInCoolingTowers',
  EXPORT_ANALYSIS_OF_WATER = '/chart/dict/AnalysisOfWaterUsedInCoolingTowers/export',
  EXPORT_AIR_ENERGY_PRICE = '/generalExport/exportAirEnergyPrice',
  
}
export const chartchildDataLengReExport = (params) =>
  defHttp.get<ChartData>({
    url: Api.CHART_CHILD_childDataLengRe_EXPORT,
    params,
    responseType: 'blob',
  })
export const getchildDataLengRePie = (params) =>
  defHttp.get<ChartData>({ url: Api.child_Data_LengRePie, params })
export const getOneChartData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_CHART_ONE, params })
export const getChartListData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_CHART_LIST, params })
export const getChartChildListData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_CHART_CHILD_LIST, params })
export const getChartChildRealTimeData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_CHART_CHILD_REAL_TIME_LIST, params })
export const getAnalysisOfEnergy = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_ANALYSIS_OF_ENERGY, params })
export const exportAnalysisOfEnergy = (params) =>
  defHttp.get<ChartData>({ url: Api.EXPORT_ANALYSIS_OF_ENERGY, params, responseType: 'blob' })

export const getMAUEnergyConsumptionAnalysis = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_MAU_ENERGY_CONSUMPTION_ANALYSIS, params })
export const exportMAUEnergyConsumptionAnalysis = (params) =>
  defHttp.get<ChartData>({ url: Api.EXPORT_MAU_ENERGY_CONSUMPTION_ANALYSIS, params, responseType: 'blob' })
export const getAnalysisOfWaterUsedInCoolingTowers = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_ANALYSIS_OF_WATER, params })
export const exportAnalysisOfWaterUsedInCoolingTowers = (params) =>
  defHttp.get<ChartData>({ url: Api.EXPORT_ANALYSIS_OF_WATER, params, responseType: 'blob' })

export const getChartChildDivListData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_CHART_CHILD_LIST_Div, params })
export const getChartChildCopListData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_CHART_CHILD_LIST_COP, params })

export const chartChildLisExport = (params) =>
  defHttp.get<ChartData>({ url: Api.CHART_CHILD_LIST_EXPORT, params, responseType: 'blob' })
export const chartChildLisExportNew = (params) =>
  defHttp.get<ChartData>({ url: Api.CHART_CHILD_LIST_EXPORTNEW, params, responseType: 'blob' })
export const getPieChartChildListData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_PIE_CHART_CHILD_LIST, params })
export const getTypeUsageCostChartData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_TYPE_USAGE_COST_CHART_DATA, params })
export const getTypeUsageCostChartDatafoByProportion = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_TYPE_USAGE_COST_CHART_DATA_FOBY_PROPORTION, params })

export const getTotalCodeAndInfo = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_totalCodeAndInfo, params })
export const geTn2UnitPriceChartData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_TYPE_USAGE_COST_n2UnitPrice_DATA, params })

export const getChildDataCostDiv = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_TYPE_USAGE_COST_CHART_UPPTOWFS_DATA, params })
export const getChildCostChartData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_CHILD_COST_CHART_DATA, params })
export const getCostChartData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_COST_CHART_DATA, params })

export const getCostChartDataAvg = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_COST_CHARTAVG_DATA, params })

export const getWeeklyReportChartData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_PIE_CHART_CHILD_LIST, params })

export const getWeeklyDatachainData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_WEEKLY_DATACHAIN_DATA, params })

export const getWeeklyTotalDatachainData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_WEEKLY_TOTAL_DATACHAIN_DATA, params })
export const GeneralExportData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_GENERALEXPORT_DATA, params, responseType: 'blob' })
export const GeneralWeeklyExportData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_GENERALEXPORT_weekly_DATA, params, responseType: 'blob' })

export const exportAirEnergyPrice = (params) =>
  defHttp.get<ChartData>({ url: Api.EXPORT_AIR_ENERGY_PRICE, params, responseType: 'blob' })

export const getSelectTgmData = (params) =>
  defHttp.get<ChartData>({ url: Api.GET_SELECTGM_DATA, params })

export const postTgmConsumptionAddOrUpdate = (data: any) =>
  defHttp.post({ url: Api.POST_TGM_ADDORUPDATE, data })
export const selectCcssConsumptionData = (params) =>
  defHttp.get({ url: Api.GET_CCSS_SELECTCCSSCONSUMPTIONDATA, params })
export const selectCcssEmissionData = (params) =>
  defHttp.get({ url: Api.GET_CCSS_SELECTCCSSEMISSIONDATA, params })

export const cssConsumptionAddOrUpdate = (data: any) =>
  defHttp.post({ url: Api.POST_CCSS_CONSUMPTIONADDORUPDATE, data })
//新增化学品废液排放量
export const ccssEmissionAddOrUpdate = (data: any) =>
  defHttp.post({ url: Api.POST_CCSS_EMISSIONADDORUPDATE, data })

export const GETchildDatAverageSum = (
  params, //能管消耗分布-MAU送风量
) => defHttp.get({ url: Api.GET_CHILDDATAVERAGESUM, params })

export const getTemperatureAndHumidityTwoDay = (params) =>
  defHttp.get({ url: Api.GET_AIRTEMPERATURE, params })

export const getSingleCaseUsageAndComprehensiveCost = (params) =>
  defHttp.get({ url: Api.GET_SINGLECASEUSAGEANDCOMPREHENSIVECOST, params })

export const getStackUsageAndComprehensiveCost = (params) =>
  defHttp.get({ url: Api.GET_STACKUSAGEANDCOMPREHENSIVECOST, params })

export const getCOMPREHENSIVESINGLECOST = (params) =>
  defHttp.get({ url: Api.GET_COMPREHENSIVESINGLECOST, params })
export const getDataSingleTotalAndMoreSon = (params) =>
  defHttp.get({ url: '/chart/dict/dataSingleTotalAndMoreSon', params })

export const getChildRealTimeDataAndSon = (params) =>
  defHttp.get({ url: '/chart/dict/childRealTimeDataAndSon', params })

export const exportCcssConsumptionData = (params) =>
  defHttp.get<ChartData>({ url: '/ccss/consumption/selectCcssConsumptionData/export', params, responseType: 'blob' })

export const exportTgmData = (params) =>
  defHttp.get<ChartData>({ url: '/tgm/consumption/selectTgmData/export', params, responseType: 'blob' })

export const thisCycleData = (params) =>
  defHttp.post({ url: '/chart/thisCycleData', params })
export const compareBarChart = (params) =>
  defHttp.post({ url: '/chart/compareBarChart', params })

export const exportCompCareBarChart = (params) =>
  defHttp.post<ChartData>({ url: '/chart/compareBarChart/export', params, responseType: 'blob' })